home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 3 / Cream of the Crop 3.iso / comm / spar372.zip / DEVICE_P.H < prev    next >
C/C++ Source or Header  |  1993-12-17  |  5KB  |  168 lines

  1. /*
  2. ** $Source: dh1:network/parnet/Sana2/Sources/device_protos.h,v $
  3. ** $State: Exp $
  4. ** $Revision: 37.2 $
  5. ** $Date: 93/12/17 22:09:05 $
  6. ** $Author: S.A.Pechler $
  7. **
  8. ** Amiga SANA-II Example PARnet device driver.
  9. **
  10. ** Based on the SANA-II Example SLIP device driver.
  11. **
  12. ** Portions (C) Copyright 1992 Commodore-Amiga, Inc.
  13. **
  14. */
  15.  
  16. /* The time.h header file in the AmiTCP distibution makes a nasty patch
  17.  * in the timeval structure. It must be included before other structures
  18.  * make use of timeval (Sana2DeviceStats does).
  19.  */
  20. #ifdef AmiTCP
  21. # include <sys/time.h>
  22. #endif
  23.  
  24. #include "spar_device.h"
  25.  
  26. #include <dos/dostags.h>
  27. #include <dos/rdargs.h>
  28. #include <intuition/intuition.h>
  29.  
  30. #include <clib/exec_protos.h>
  31. #include <clib/dos_protos.h>
  32. #include <clib/utility_protos.h>
  33. #include <clib/timer_protos.h>
  34. #include <clib/alib_stdio_protos.h>
  35. #include <clib/intuition_protos.h>
  36.  
  37. #include <pragmas/exec_pragmas.h>
  38. #include <pragmas/dos_pragmas.h>
  39. #include <pragmas/utility_pragmas.h>
  40. #include <pragmas/timer_pragmas.h>
  41. #include <pragmas/intuition_pragmas.h>
  42.  
  43. #include <string.h>
  44.  
  45.  
  46. /* Correct prototype for the CheckIO.
  47.  * (The one in clib/exec_protos.h has wrong return value type: BOOL (16 bits) 
  48.  * instead of a pointer (32 bits)!)
  49.  */
  50. struct IORequest *CheckIO(struct IORequest *req);
  51.  
  52.  
  53. /* Prototypes for functions defined in device_funcs.c
  54.  */
  55. LONG __asm DevOpen( register __a1 struct IOSana2Req * ios2,
  56.                     register __a6 struct SPARDevice *SPARDevice,
  57.                     register __d0 ULONG s2unit,
  58.                     register __d1 ULONG s2flags);
  59. BPTR __asm DevClose(register __a1 struct IOSana2Req * ios2,
  60.                     register __a6 struct SPARDevice *SPARDevice);
  61. BPTR __asm DevExpunge(register __a6 struct SPARDevice *SPARDevice);
  62. struct SPARDevUnit *InitSPARUnit(ULONG s2unit);
  63. VOID ExpungeUnit(struct SPARDevUnit *sdu);
  64. BOOL ReadConfig(struct SPARDevUnit *sdu);
  65. VOID __asm DevBeginIO(register __a1 struct IOSana2Req * ios2,
  66.                       register __a6 struct SPARDevice *SPARDevice);
  67. VOID PerformIO(struct IOSana2Req *ios2);
  68. VOID GetSpecialStats(struct SPARDevUnit *sdu,
  69.                      struct IOSana2Req *ios2);
  70. VOID GetGlobalStats(struct SPARDevUnit *sdu,
  71.                     struct IOSana2Req *ios2);
  72. VOID GetTypeStats(struct SPARDevUnit *sdu,
  73.                   struct IOSana2Req *ios2);
  74. VOID TrackType(struct SPARDevUnit *sdu,
  75.                struct IOSana2Req *ios2);
  76. VOID UnTrackType(struct SPARDevUnit *sdu,
  77.                  struct IOSana2Req *ios2);
  78. VOID PacketReceived(struct SPARDevUnit *sdu,
  79.                     ULONG length);
  80. VOID PacketSent(struct SPARDevUnit *sdu,
  81.                 ULONG length);
  82. VOID PacketOverrun(struct SPARDevUnit *sdu);
  83. VOID ReceivedGarbage(struct SPARDevUnit *sdu);
  84. VOID PacketDropped(struct SPARDevUnit *sdu);
  85. VOID TermIO(struct IOSana2Req *ios2);
  86. LONG __asm DevAbortIO(register __a1 struct IOSana2Req * ios2,
  87.                       register __a6 struct SPARDevice *SPARDevice);
  88. LONG AbortReq(struct MinList *minlist,
  89.                struct IOSana2Req *ios2);
  90. VOID ConfigInterface(struct SPARDevUnit *sdu,
  91.                      struct IOSana2Req *ios2);
  92. VOID GetStationAddress(struct SPARDevUnit *sdu,
  93.                        struct IOSana2Req *ios2);
  94. VOID BroadcastPacket(struct SPARDevUnit *sdu,
  95.                      struct IOSana2Req *ios2);
  96. VOID DeviceQuery(struct SPARDevUnit *sdu,
  97.                  struct IOSana2Req *ios2);
  98. VOID WritePacket(struct SPARDevUnit *sdu,
  99.                  struct IOSana2Req *ios2);
  100. VOID SendPacket(struct SPARDevUnit *sdu,
  101.                 struct IOSana2Req *ios2);
  102. VOID ReadPacket(struct SPARDevUnit *sdu,
  103.                 struct IOSana2Req *ios2);
  104. VOID ReadOrphan(struct SPARDevUnit *sdu,
  105.                 struct IOSana2Req *ios2);
  106. VOID ReceivedOrphan(struct SPARDevUnit *sdu);
  107. BOOL InitPARnet(struct SPARDevUnit *sdu);
  108. VOID DeinitPARnet(struct SPARDevUnit *sdu);
  109. VOID OnEvent(struct SPARDevUnit *sdu,
  110.              struct IOSana2Req *ios2);
  111. BOOL OpenPARnet(struct SPARDevUnit *sdu);
  112. VOID MarkTimeOnline(struct SPARDevUnit *sdu);
  113. VOID ClosePARnet(struct SPARDevUnit *sdu);
  114. VOID Online(struct SPARDevUnit *sdu,
  115.             struct IOSana2Req *ios2);
  116. VOID Offline(struct SPARDevUnit *sdu,
  117.              struct IOSana2Req *ios2);
  118. VOID DoEvent(struct SPARDevUnit *sdu,
  119.              ULONG event);
  120. VOID DoOffline(struct SPARDevUnit *sdu);
  121. VOID ServiceTxPort(struct SPARDevUnit *sdu,
  122.              struct IOParReq *ioPar);
  123. VOID DoPARnet(struct SPARDevUnit *sdu,
  124.               struct IOParReq *ioPar);
  125. VOID GotPacket(struct SPARDevUnit *sdu,
  126.                ULONG length);
  127. VOID QueueParRequest(struct SPARDevUnit *sdu);
  128. VOID __asm DevProcCEntry(VOID);
  129. VOID NewList(struct List *list);
  130.  
  131. /*
  132. ** External variables and functions
  133. **
  134. */
  135.  
  136. /* the __far keyword is only needed for data structures which are
  137. ** in a different segment. Otherwise the linker will complain.
  138. */
  139. /* __far */
  140. extern struct SPARDevice *ExtDeviceBase;
  141.  
  142. #ifdef Rhialto 
  143. extern ULONG IPToNum(STRPTR ipstr);
  144. extern VOID kprintf(STRPTR fmt, ...);
  145. #endif
  146.  
  147. /* Debugging facilities.
  148.  */
  149. #ifdef DEBUG
  150. #  ifdef __STDC__
  151.     void LogMessage(char *fmt, ...);
  152. #  else
  153.     void LogMessage(va_alist)
  154.     va_dcl;
  155. #  endif
  156.    void initsyslog(void);
  157.    void uninitsyslog(void);
  158. #  define debug(x) LogMessage x;
  159. #else
  160.   /* No debugging */
  161.   void initintuition(void);
  162.   void uninitintuition(void);
  163. # define debug(x)
  164. # define initsyslog(x) initintuition (x);
  165. # define uninitsyslog(x) uninitintuition (x);
  166. #endif /* DEBUG */
  167.  
  168.